/* fat_dir.c
 *
 * Copyright (C) 2010 Ricardo R. Massaro
 */

#ifndef FAT_DIR_FILE_H
#define FAT_DIR_FILE_H

typedef struct FAT_DIR {
  unsigned int max_entries;
  unsigned int used_entries;
  unsigned char *cluster_data;
  int first_cluster;
  int n_clusters;
  int parent_cluster;
} FAT_DIR;

void fat_dir_init(FAT_DIR *dir, unsigned char *cluster_data, int first_cluster, int n_clusters, int parent_cluster);
int fat_dir_add_volume_label(FAT_DIR *dir, const char *label);
int fat_dir_add_file(FAT_DIR *dir, const char *filename, int start_cluster, int num_free_clusters);
int fat_dir_add_dir(FAT_DIR *dir, const char *filename, int start_cluster);

#endif /* FAT_DIR_FILE_H */
